#pragma once
#include <iostream>


class Si {
protected:
	double value;

	void Assign(const double& val);
public:
	enum Exceptions{MINUS};

	Si(const double& val = 0);

	bool operator<(const Si& rhs)  const { return value < rhs.value; }
	bool operator>(const Si& rhs)  const { return rhs.value < value; }
	bool operator==(const Si& rhs) const { return !(rhs.value < value) && !(value < rhs.value); }

	bool operator==(const double& rhs) const { return value == rhs; }

	virtual Si operator-(const Si& rhs) const { return value - rhs.value; }
	virtual Si operator-=(const Si& rhs){ return value -= rhs.value; }
	virtual Si operator+=(const Si& rhs){ return value += rhs.value; }
	virtual Si operator=(const Si& rhs){ return value = rhs.value; }

	virtual Si operator/(const double& rhs) const { return value / rhs; } 

	friend std::istream& operator>>(std::istream& is, Si& rhs);
	friend std::ostream& operator<<(std::ostream& os, const Si& rhs);
};

class Kg : public Si {
public:
	Kg(const double& val = 0) : Si(val) {}

	Kg operator+=(const Kg& rhs){ return value += rhs.value; }
	Kg operator-(const Kg& rhs) const { return value - rhs.value; }
};

class Meter : public Si {
public:
	Meter(const double& val = 0) : Si(val) {}
};
